//
//  VMCMacros.h
//  vmcshop
//
//  Created by bigknife on 14-10-9.
//  Copyright (c) 2014年 idongler. All rights reserved.
//

#ifndef vmcshop_VMCMacros_h
#define vmcshop_VMCMacros_h

#define OSVersionLessThan7 (floor(NSFoundationVersionNumber) < floor(NSFoundationVersionNumber_iOS_7_0))

#ifdef DEBUG
#define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#define BASEURL				@"http://testm.snerdi.com.cn/index.php/openapi/"
//#define HTML_URL			@"http://test.yaoking.cn/"     //82页面地址测试环境，80正式环境
//@"http://testm.snerdi.com.cn/"
#define HTML_URL			@"http://www.shanyaohui.com:82/m/"
#else

#define DLog(...)
#define BASEURL				@"http://testm.snerdi.com.cn/index.php/openapi/"
//#define BASEURL				@"http://test.yaoking.cn/openapi/"
#define HTML_URL			@"http://www.shanyaohui.com:82/m/"
#endif

#ifdef DEBUG
#   define AlertLog(fmt, ...)  { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:@"%s\n [Line %d] ", __PRETTY_FUNCTION__, __LINE__] message:[NSString stringWithFormat:fmt, ##__VA_ARGS__]  delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil]; [alert show]; }
#else
#   define AlertLog(...)
#endif
//微信支付
#define	 APP_ID				@"wx91bc4ceb299e1243"
#define	 AppSecret          @"05d393bea2e4b89c1705e91f73cfb42c"

#define RGBA(r,g,b,a)	[UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a]
#define RGB(r,g,b)	[UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:1.0]
#define EMPTY_IF_NIL(str) (str == nil ? @"" : (str == (id)[NSNull null] ? @"" : str))
#define NOT_NULL(v) (v && (v) != (id)[NSNull null])
#define INSTANCE_OF(obj,cls) ([obj isKindOfClass:[cls class]])

#import "AFNetworking.h"
#define kNetworkReachability ([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus > 0)  //有网

#define TOAST(str) ([[UIApplication sharedApplication].keyWindow makeToast:str duration:1.0f position:@"center"])

#define SYSTEMVERSION ([[UIDevice currentDevice].systemVersion doubleValue])

#define API_SIGN_TOKEN @"2570697f11fc2eac69c72b5a7a8d7582a7d1fb98b0342d677b36d47f9e5e863a"
#define MyWidth [UIScreen mainScreen].bounds.size.width
#define MyHeight [UIScreen mainScreen].bounds.size.height

//主体颜色
#define MainColor [UIColor colorWithString:@"#003274"]
//生成属性字符串 (字符串内容，字体大小，字体颜色)
#define ATTRIBUTE_STRING(string,font,color)		([[NSAttributedString alloc] initWithString:string attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:font],NSForegroundColorAttributeName:color}])
//生成属性字符串 (字符串内容，字体大小)
#define ATTRIBUTE_STR(string,font)		([[NSAttributedString alloc] initWithString:string attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:font]}])
//App下载链接
//#define APP_DOWNLOAD		@"https://itunes.apple.com/us/app/shan-yao-hui/id1052678077?l=zh&ls=1&mt=8"
//首页
#define HOME_URL			@"index.html"
//闪耀商城
#define LIST_URL			@"list.html"
//购物车
#define CART_URL			@"cart.html"
//会员中心
#define MY_URL			    @"my.html"
//韩妆学院
#define SCHOOL_URL			@"school-school.html"

#define DO_LOGIN			@"pass-dologin.html"
#define MY_MESSAGELIST		@"notice-xiaoxi.html"

//百度推送APIKey
#define BaiDu_APIKEY		@"RnEdIGqSIDieSPALTItixTHC"
//蒲公英APP ID
#define PGY_APPID			@"1fb76c842d79a9388416444d3132f497"
//蒲公英APP KEY	
#define PGY_APPKEY			@"d365bf39a7048f138d8e47e8944e1fa9"
#endif
